//
//  LJHImaWorTableCell.m
//  HEARME
//
//  Created by liujinhui on 16/1/22.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LJHImaWorTableCell.h"
#import "UIImageView+WebCache.h"
@interface LJHImaWorTableCell ()

@property(nonatomic,retain)UIImageView *imaPic;
@property(nonatomic,retain)LJHBaseLable *shortLable;
@property(nonatomic,retain)LJHBaseLable *longLable;
@property(nonatomic,retain)UIImageView *imaChange;
@property(nonatomic,retain)LJHBaseLable *numLable;
@property(nonatomic,retain)UIImageView *imaMore;

@end

@implementation LJHImaWorTableCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createCell];
    }
    return self;
}
-(void)createCell
{
    
    self.imaPic = [[UIImageView alloc]initWithFrame:CGRectMake(15, 15, WIDTH/4.5,WIDTH/4.5)];
//    self.imaPic.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.imaPic];
    
    self.shortLable = [[LJHBaseLable alloc]initWithFrame:CGRectMake(15+WIDTH/4.5, 15, WIDTH-50-15-WIDTH/4.5, HEIGHT/7/3)];
//    self.shortLable.backgroundColor = [UIColor colorWithRed:0.817 green:1.000 blue:0.982 alpha:1.000];
    [self.contentView addSubview:self.shortLable];
    
    self.longLable = [[LJHBaseLable alloc]initWithFrame:CGRectMake(15+WIDTH/4.5, 15+HEIGHT/7/3, WIDTH-50-15-WIDTH/4.5, HEIGHT/7/3)];
//    self.longLable.backgroundColor = [UIColor colorWithRed:1.000 green:0.978 blue:0.776 alpha:1.000];
    [self.contentView addSubview:self.longLable];
    
    self.iconImage = [[UIImageView alloc] initWithFrame:CGRectMake(15+WIDTH/4.5, self.longLable.frame.origin.y + self.longLable.frame.size.height + 5, 20*(WIDTH/375), 20*(HEIGHT/667))];
    self.iconImage.backgroundColor = [UIColor clearColor];
    self.iconImage.image = [UIImage imageNamed:@"find_specialicon"];
    [self.contentView addSubview:self.iconImage];
    [self.iconImage release];
    
    self.numLable = [[LJHBaseLable alloc]initWithFrame:CGRectMake(15+WIDTH/4.5+30, 15+HEIGHT/7/3*2, WIDTH-50-15-WIDTH/4.5-50, HEIGHT/7/3)];
//    self.numLable.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:self.numLable];
    
    self.imaMore = [[UIImageView alloc]initWithFrame:CGRectMake(WIDTH-30, (15+HEIGHT/7)/2.5, 20, 20)];
    self.imaMore.image = [UIImage imageNamed:@"cell_arrow@2x.png"];
    [self.contentView addSubview:self.imaMore];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(void)setModel:(LJHChildListModel *)model
{
    if (_model!=model) {
        [_model release];
        _model = [model retain];
    }
    self.shortLable.text = _model.title;
    self.longLable.text = _model.subtitle;
    self.longLable.font = [UIFont systemFontOfSize:14];
//    self.longLable.textColor = [UIColor grayColor];
    self.numLable.text = _model.footnote;
    self.numLable.font = [UIFont systemFontOfSize:12];
//    self.numLable.textColor = [UIColor grayColor];
    NSURL *url = [NSURL URLWithString:_model.coverPath];
    [self.imaPic sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"1024.jpg"]];
}

@end
